<div class="sc-cnt-materias">
        
<div class="col itg-mn-disciplina">
    <h2><?php echo $this->dis['DCP_NOM']; ?></h2>
    <h3><?php echo $this->dis['PRS_NOM']; ?></h3>

    <ul>
    <?php 
        foreach($this->menu as $row){ ?> 
        <li><a href="<?php echo $this->baseUrl($this->modulo.'/materiais/index/dcp_id/'.$row['DCP_ID'].'/prs_id/'.$row['PRS_ID']); ?>"><?php echo $row['DCP_NOM']; ?></a></li>
    <?php } ?>
    <ul> 

</div> 

    <?php foreach($this->topicos as $key => $top){
        
        $query = 'SELECT SQL_CACHE c.*, ac.ALC_ID FROM CONTEUDO c '
                . 'LEFT JOIN ALUNO_CONTEUDO ac ON c.CON_ID = ac.CON_ID AND c.TPC_ID = ac.TPC_ID AND ac.ALU_ID = '.$this->ALU_ID.' '
                . 'WHERE c.TPC_ID = '.$top['TPC_ID'].' AND c.CON_STA = 1 ORDER BY c.CON_ORD ASC';
        $conteudo = $this->db->fetchAll($query);
        
        $a_txt = $key == 0 ? '+':'+';
    ?>
    <div class="content-tb">
        <div class="tl-pag"><span class="ver-material"><?php echo $a_txt; ?></span><?php  echo $top['TPC_NOM']; ?></div>
        <table style="display: none;" class="nrmprd tb-toc">          
        <?php foreach($conteudo as $con){ ?> 
            <tr>
                <td class="bc" style="width: 60px">
                    <?php if($con['ALC_ID'] > 0) { ?>
                        <span class="lido">acessado</span> 
                    <?php } else { ?>
                        <span class="n-lido">não acessado</span>
                    <?php } ?>
                </td>
                <td><?php echo $con['CON_NOM'];?></td>
                <td style="width: 65px"><?php echo Datetools::amd_dma(substr($con['CON_DATHOR'],0,10));?></td>
                <td style="width: 35px"><?php echo substr($con['CON_DATHOR'],11,5);?>h</td>
                <?php if($con['TIP_ID'] == 1){ ?>
                <td style="width: 120px" class="bc"><a class="btn video" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'play', 'id' => $con['CON_ID'],'tpc_id' => $top['TPC_ID'])); ?>"><span class="icn_vid"></span></a></td>
                <?php } else { 
                    $arq = imagem::formatNomeArquivo($con['CON_ID'],$con['CON_DATHOR']);
                    $img = glob('public/upload/conteudo/'.$arq.'.*');
                    
                    if(isset($img[0])) {
                        $arq = $img[0];
                        $ext = imagem::extensao($arq);
                    }
                    $icn = dominio::getClassIcon($ext);   
                ?>
                <td style="width: 120px" class="bc"><a class="btn download" itemid="<?php echo $con['CON_ID']; ?>" itemref="<?php echo $top['TPC_ID']; ?>" href="<?php echo $this->urlbase.'/'.$img[0]; ?>" target="_black"><span class="<?php echo $icn; ?>"></span></a></td>
                <?php } ?>
            </tr>
        <?php } ?>
        </table>
    </div>
    <?php } ?>
    
    
</div>

<?php //echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>
<?php if($this->turma['CUR_REDENV'] > 0) { ?>
<div class="enviar_redacao">
    <form action="" method="post" enctype="multipart/form-data">
        ENVIE A SUA REDAÇÃO <input type="file" placeholder="carregar arquivo" name="arquivo" />  <input type="submit" name="enviar" value="enviar" />
    </form>
</div>    
<?php } ?>